type MonitorType =
	| 'JS_ERROR'
	| 'PROMISE_ERROR'
	| 'RESOURCES_ERROR'
	| 'EXPOSURE'
	| 'AUTOMATIC_BURIAL_POINT'
	| 'PAGE_DWELL_TIME'
	| 'PV'
	| 'PERFORMANCE'
	| 'RES_PERFORMANCE'
	| 'XHR'
	| 'BLANKSCREEN'
	| 'BEHAVIOR_RECORDER'
	| 'LONG_TASK';

interface ReportParams {
	type: MonitorType | string;
	[key: string]: any;
}

interface MonitorSdkConfig {
	pId: string;
	reportUrl: string;
	reportInterval?: number;
	batchSize?: number;
	jsErrorLog?: boolean;
	promiseErrorLog?: boolean;
	resourcesErrorLog?: boolean;
	perfLog?: boolean;
	resourcesPerfLog?: boolean;
	xhrLog?: boolean;
	pvLog?: boolean;
	pageDwellTimeLog?: boolean;
	exposureLog?: boolean;
	automaticBurialPointLog?: boolean;
	blankScreenLog?: boolean;
	behaviorRecorderLog?: boolean;
	longTaskLog?: boolean;
	debug?: boolean;
	ignoreWhiteScreenElements?: Array<string>;
	reportParamsFormat?: (params: ReportParams) => ReportParams;
	reportUploadBefore?: (params: Array<ReportParams>) => void;
	reportUploadAfter?: (params: Array<ReportParams>) => void;
	// 采样率
	sampleRate?: {
		perf?: number;
		resourcesPerf?: number;
		xhr?: number;
		pv?: number;
		pageDwellTime?: number;
		exposure?: number;
		automaticBurialPoint?: number;
		behaviorRecorder?: number;
	};
}

type TypeTracker = Pick<
	MonitorSdkConfig,
	| 'reportUrl'
	| 'debug'
	| 'reportParamsFormat'
	| 'reportUploadBefore'
	| 'reportUploadAfter'
	| 'sampleRate'
	| 'reportInterval'
	| 'batchSize'
>;

export { MonitorSdkConfig, TypeTracker, ReportParams, MonitorType };
